﻿//////////////////////////////////////////////////////////////////////////////////// Licensed under the MIT License//// Copyright (c) 2008 Chris Colinsky// All Rights Reserved//// version	0.4// http://code.google.com/p/sugarcookie/// http://code.google.com/p/sugarcookie/wiki/License//////////////////////////////////////////////////////////////////////////////////import sugarcookie.utils.RegExp;import sugarcookie.validators.ValidationResult;class sugarcookie.validators.EmailValidator {	public static function validate(value:Object):ValidationResult {		if (RegExp.match(value,"/^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$/")) return new ValidationResult("Email is valid",false);		else return new ValidationResult("Email is not a valid format",true);	}}